package com.fy.controller;

import com.fy.entity.Ca_info;
import com.fy.dao.Ca_infoMapper;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;


@RestController
@RequestMapping("/cainfo")
public class Ca_infoController {
    String id = "1";
    @Resource
    Ca_infoMapper ca_infoMapper;

    @GetMapping("/getAll")
    public List<Ca_info> ca_infoMapper() {
        return ca_infoMapper.findAll();
    }

    @PostMapping("/insert")
    public String insert(String ca_id, String ca_pic, String ac_id) {
        ca_infoMapper.insert_ca_info(id, ca_pic, ac_id);
        id=(Integer.valueOf(id)+1+"");
        return "200";
    }


}
